package com.mcp.mcpserver.model;
/**
 * @author zhangxin569
 * @date 2025/8/6
 */
public class McpResponse {
    private boolean success;
    private Object data;
    private McpError error;

    // Getters and Setters
    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public McpError getError() {
        return error;
    }

    public void setError(McpError error) {
        this.error = error;
    }

    // Static factory methods
    public static McpResponse success(Object data) {
        McpResponse response = new McpResponse();
        response.setSuccess(true);
        response.setData(data);
        return response;
    }

    public static McpResponse error(String code, String message) {
        McpResponse response = new McpResponse();
        response.setSuccess(false);
        response.setError(new McpError(code, message));
        return response;
    }
}